﻿using DAL.Permission.Store;
using Model.Permission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.Permission.Store
{
    public class ExtendedRoleAuthorityBLL
    {
        ExtendedRoleAuthorityDAL dal = new ExtendedRoleAuthorityDAL();

        /// <summary>
        /// 是否拥有某种权限
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public bool HavePermission(string tag, int userid)
        {
            return dal.HavePermission(tag, userid);
        }

        /// <summary>
        /// 是否拥有某种权限
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public bool HavePermission(int rightID, int userid)
        {
            return dal.HavePermission(rightID, userid);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int ExtendedRoleAuthorityID)
        {
            return dal.Exists(ExtendedRoleAuthorityID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ExtendedRoleAuthorityEntity model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ExtendedRoleAuthorityEntity model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除某角色的所有授权数据
        /// </summary>
        public bool Delete(int RoleID)
        {

            return dal.Delete(RoleID);
        }

        /// <summary>
        /// 删除数据
        /// </summary>
        public bool Delete(int Roleid, string mtid)
        {
            return dal.Delete(Roleid, mtid);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string ExtendedRoleAuthorityIDlist)
        {
            return dal.DeleteList(ExtendedRoleAuthorityIDlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ExtendedRoleAuthorityEntity GetModel(int ExtendedRoleAuthorityID)
        {

            return dal.GetModel(ExtendedRoleAuthorityID);
        }

    }
}
